Skip to content

fix: pass explicit node_limit in index_resource to avoid ls truncation#1344

Open
yc111233 wants to merge 1 commit intovolcengine:mainfrom
yc111233:fix/index-resource-node-limit
Open

fix: pass explicit node_limit in index_resource to avoid ls truncation#1344
yc111233 wants to merge 1 commit intovolcengine:mainfrom
yc111233:fix/index-resource-node-limit

Conversation

@yc111233
Copy link
Copy Markdown
Contributor

@yc111233 yc111233 commented Apr 9, 2026

Summary

  • viking_fs.ls() defaults to node_limit=1000, which silently truncates results for directories with more than 1000 entries
  • index_resource calls ls() without specifying node_limit, so large memory directories (e.g. 1800+ files) get silently truncated
  • Files beyond the 1000 limit are never vectorized, resulting in incomplete vector indexes and missing search results

Root cause

viking_fs.ls() signature (line 1743):

async def ls(self, uri, ..., node_limit=1000)

index_resource (line 354) calls it with default:

files = await viking_fs.ls(uri, ctx=ctx)  # node_limit defaults to 1000

Fix

Pass node_limit=10000 explicitly:

files = await viking_fs.ls(uri, ctx=ctx, node_limit=10000)

Impact

Directories with up to 10,000 files will now be fully indexed. This fixes silent data loss during reindexing of large memory stores.

Test plan

  • Create a directory with >1000 files, run index_resource
  • Verify all files are vectorized (not just the first 1000)
  • Check vector count matches file count

🤖 Generated with Claude Code

viking_fs.ls() defaults to node_limit=1000, which silently truncates
the file listing for directories with more than 1000 entries. This
causes index_resource to miss files when reindexing large memory
directories (e.g. 1800+ files), resulting in incomplete vector
indexes.

Fix: pass node_limit=10000 explicitly to viking_fs.ls() in
index_resource to support larger directories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🏅 Score: 90
🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

PR Code Suggestions ✨

No code suggestions found for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant